package struts.config;

import java.io.IOException;
import java.util.List;

import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.SAXBuilder;

public class Struts_config {
	public Struts_config(){}
	public void add() throws  Exception{
		SAXBuilder builder = new SAXBuilder();
		Document doc = builder.build("WebContent/WEB-INF/struts-config.xml");
		Element root = doc.getRootElement();
		Element actionform = root.getChild("formbeans");
		List<Element> list = actionform.getChildren();
		for (Element e : list) {
			String name = e.getAttributeValue("name");
			String clazz = e.getAttributeValue("class");
			System.out.println(name+" 111 "+ clazz);
		}
		
	}
	public static void main(String[] args) throws Exception {
		Struts_config s= new Struts_config();
		s.add();
	}
}
